<script type="text/javascript">
//when click view larger
$(document).ready(function() {
$('#size').val('');
$('#colour').val('');
$('#specialColour').val('');
//show all image except image floor plan
jQuery('#img_viewlarger a').lightBox({
'fixedNavigation' : 'true',
'imageLoading':'{{$LAYOUT_HELPER_URL}}front/images/lightbox-ico-loading.gif',// (string) Path and the name of the loading icon
'imageBtnPrev':'{{$LAYOUT_HELPER_URL}}front/images/lightbox-btn-prev.gif',// (string) Path and the name of the prev button image
'imageBtnNext':'{{$LAYOUT_HELPER_URL}}front/images/lightbox-btn-next.gif',// (string) Path and the name of the next button image
'imageBtnClose':'{{$LAYOUT_HELPER_URL}}front/images/lightbox-btn-close.gif',// (string) Path and the name of the close btn
'imageBlank':'{{$LAYOUT_HELPER_URL}}front/images/lightbox-blank.gif'
});
});
</script>
<div class="content_ht_block">
<div class="block_top_2"></div>
<div class="block_list_2">
<div class="content_title_top">
<div class="content_title_left">
<div class="heading_bg_left"></div>
<div class="heading_bg_repeat">{{l}}Chi tiết sản phẩm{{/l}}</div>
<div class="heading_bg_right"></div>
</div>
</div><div class="cate_ht">
<div class="dongphuc_center">
<table width="462" cellspacing="0" cellpadding="0" border="0">
<tbody><tr>
<td class="dongphuc_detail">
<div id="img_viewlarger">
<table width="100%" cellspacing="0" cellpadding="0" border="0" >
<tbody>
<tr>
<td style="width:100%; text-align: center; vertical-align: middle;">
<a href="{{$BASE_URL}}{{$product.full_main_image}}" title="" alt="">
<img  id="dongphuc_detail_img" style="padding-left:2px;padding-top:2px;" alt="" src="{{$BASE_URL}}{{$product.main_image}}">
</a>
</td>
</tr>
</tbody></table>
</div>
</td>
</tr>

<form action="{{$BASE_URL}}card/index/index" method="post" id="card" name="card">
<tr>
<td style="font-size: 12px;" class="">
   <br>
<p> <b>{{l}}Tên sản phẩm:{{/l}}</b> {{$product.title}}</p>


<p><b>{{l}}Chất liệu:{{/l}}</b> {{$product.material}}</p>

<p><b>{{l}}Giá:{{/l}}</b> {{$product.price}} {{$product.price_extension}}</p>
<br>

<b>{{l}}Miêu tả:{{/l}}</b> {{$product.full_text}}
<br>

</td>
</tr>


<tr>
<td class="dongphuc_detail_text1">
{{l}}Xin bạn vui lòng nhập vào các thông tin sau.{{/l}}<br>
<font style="color:red;">{{$mess}}</font>
</td>
</tr>
<tr>
<td class="xinlienhe_box"><table width="100%" cellspacing="0" cellpadding="0" border="0">
<tbody>
{{if $product.attributes.1 != ""}}
<tr bgcolor="#f5f3f4">
<td width="29%" class="xinlienhe_text">{{l}}Thuộc tính{{/l}}</td>
<td colspan="3">
<select class="xinlienhe_group" name="data[attributes]" id="mau_ao">
<option value="0">{{l}}Thuộc tính{{/l}}</option>
{{foreach from=$product.attributes item=item key=key}}
<option value="{{$item}}">{{$item}}</option>
{{/foreach}}
</select>
</td>
</tr>
{{else}}
<input type="hidden" value=""name="data[attributes]">
{{/if}}

<tr bgcolor="#f0eeef">
<td class="xinlienhe_text">{{l}}Số lượng{{/l}}<input type="hidden" value="{{$product.product_gid}}" name="data[id]" /></td>
<td colspan="3"><input type="text" value="" id="so_luong" name="data[count]" class="xinlienhe_tb require_field" onblur="validate_only_number('so_luong')"></td>
</tr>

<tr bgcolor="#f0eeef">
<td valign="top" align="left" class="xinlienhe_text">{{l}}Mô tả chi tiết{{/l}}</td>
<td colspan="3">
<!--<input type="text"  class="xinlienhe_tb1 require_field" id="chi_tiet" name="chi_tiet" value="" />-->
<textarea name="data[note]" id="chi_tiet" rows="7" cols="44" style="font-size: 12px;" class="require_field"></textarea>
</td>
</tr>
<tr bgcolor="#f5f3f4">
<td class="xinlienhe_text">{{l}}Mã xác nhận{{/l}}</td>
<td><input type="text" name="data[captcha]" class="xinlienhe_tb2" maxlength="6" style="text-align:center"></td>
<td width="12%"><img width="120" height="25" alt=" " style="border:0;" src="{{$LAYOUT_HELPER_URL}}front/captcha/create_image.php?r={{$randomNumber}}"></td>
<td width="37%">
{{if $LANG_CODE == vi}}
<img width="79" height="23" style="cursor:pointer" src="{{$LAYOUT_HELPER_URL}}front/images/dathang_dongphuc_bt.gif" onclick="do_submit()">
{{else}}
<img width="79" height="23" style="cursor:pointer" src="{{$LAYOUT_HELPER_URL}}front/images/dathang_dongphuc_bt_english.gif" onclick="do_submit()">
{{/if}}
  </td>
</tr>
</form>
</tbody></table></td>
</tr>
</tbody></table>

</div>
</div>
</div>
<div class="clearthis"></div>
<div class="block_bottom_2"></div>
</div>

<script type="text/javascript">
function do_submit()
{ 
	var flag = true;
	{{if $product.attributes.1 != ""}}
        if($('#mau_ao').val()==0){
		$('#mau_ao').focus();
		alert('{{l}}Vui lòng trọn thuộc tính!{{/l}}');
		flag=false;
		return false;
	}
        {{/if}}
	if($('#so_luong').val()==''){
		$('#so_luong').focus();
		alert('{{l}}Vui lòng nhập số lượng!{{/l}}');
		flag=false;
		return false;
	}
	if(flag==true){
		jQuery('#card').submit();
	}
	return;
}

function validate_only_number(field)
{
	var check = true;
	var value_number = $('#'+field).val();
	for(var i=0;i < value_number.length; ++i)
	{
		  var new_key = value_number.charAt(i);	 
		  if(((new_key < "0") || (new_key > "9")) &&!(new_key == " "))
		  {
			 check = false;
			 alert("{{l}}Vui Lòng Nhập Số.{{/l}}");
			 var temp = value_number.replace(new_key,"");
			 $('#'+field).val(temp);
			 break;
		  }else{
			   check = true;
	      }
	}
}
</script>